<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <div id="test">
        <h3 v-if="isOK">只有isOk为true才显示 v-if</h3>
        <button @click="test">更新</button>

        <h3 v-show="isOK">只有isOk为true才显示 v-show</h3>
  </div>

  <script src="../js/vue.js"></script>
  <script>
    new Vue({
      el: "#test",
      data: {
        isOK:true
      },
      methods:{
        test(){
            this.isOK = !this.isOK
        }
      }
    })
  </script>
</body>
</html>